import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 待销毁旧件列表查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPDestory/getListByPage`,  params );

// 选择销毁旧件列表
export const getDestoryListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/getDestoryListByPage`,  params );

// 旧件销毁新增
export const saveOne = params => axios.post(`${SERVER.CLAIMFAC}/rPDestory/saveOne`,  params );

// 旧件销毁申请
export const applyDestory = params => axios.post(`${SERVER.CLAIMFAC}/rPDestory/applyDestory`,  params );

// 编辑
export const edit = params => axios.get(`${SERVER.CLAIMFAC}/rPDestory/selectById/${params}`);

// 旧件销毁更新
export const updateByPtId = params => axios.post(`${SERVER.CLAIMFAC}/rPDestory/updateByPtId`,  params );

export const excelExport = params => {
  return axios({
    url:`${SERVER.CLAIMFAC}/rPDestory/getApplyQueryListForExport`,
    method: 'POST',
    data: params,
    responseType: 'blob'
  });
};
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);


// 删除客户订单(物理删除)
// export const deleteOrders = params => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/delete`, { params });


